<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateReservaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateReservaLabel_codigo}" for="codigo" />
                    <h:inputText id="codigo" value="#{reservaController.selected.codigo}" title="#{bundle.CreateReservaTitle_codigo}" required="true" requiredMessage="#{bundle.CreateReservaRequiredMessage_codigo}"/>
                    <h:outputLabel value="#{bundle.CreateReservaLabel_fecha}" for="fecha" />
                    <h:inputText id="fecha" value="#{reservaController.selected.fecha}" title="#{bundle.CreateReservaTitle_fecha}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateReservaLabel_dia}" for="dia" />
                    <h:inputText id="dia" value="#{reservaController.selected.dia}" title="#{bundle.CreateReservaTitle_dia}" />
                    <h:outputLabel value="#{bundle.CreateReservaLabel_horaInicio}" for="horaInicio" />
                    <h:inputText id="horaInicio" value="#{reservaController.selected.horaInicio}" title="#{bundle.CreateReservaTitle_horaInicio}" >
                        <f:convertDateTime pattern="HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateReservaLabel_horaFin}" for="horaFin" />
                    <h:inputText id="horaFin" value="#{reservaController.selected.horaFin}" title="#{bundle.CreateReservaTitle_horaFin}" >
                        <f:convertDateTime pattern="HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateReservaLabel_laboratorio}" for="laboratorio" />
                    <h:selectOneMenu id="laboratorio" value="#{reservaController.selected.laboratorio}" title="#{bundle.CreateReservaTitle_laboratorio}" required="true" requiredMessage="#{bundle.CreateReservaRequiredMessage_laboratorio}">
                        <f:selectItems value="#{laboratorioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateReservaLabel_profesor}" for="profesor" />
                    <h:selectOneMenu id="profesor" value="#{reservaController.selected.profesor}" title="#{bundle.CreateReservaTitle_profesor}" required="true" requiredMessage="#{bundle.CreateReservaRequiredMessage_profesor}">
                        <f:selectItems value="#{profesorController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{reservaController.create}" value="#{bundle.CreateReservaSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{reservaController.prepareList}" value="#{bundle.CreateReservaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateReservaIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
